package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanfeng.business.dto.GateQueryStoreDTO;
import com.yuanfeng.business.dto.GoodsGateDTO;
import com.yuanfeng.business.entity.ShopGateEntity;
import com.yuanfeng.business.vo.GdbShopGatePoVO;
import com.yuanfeng.business.vo.GoodsGateVO;
import com.yuanfeng.commoms.dto.goods.GoodsInfoDTO;
import com.yuanfeng.commoms.dto.shop.GateStoreUpdateDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Entity com.yuanfeng.business.entity.ShopGate
 */
@Mapper
public interface ShopGateMapper extends BaseMapper<ShopGateEntity> {
    /**
     * 查询当前用户是否是门店账号
     * @param userMobile
     * @return
     */
    Integer queryUserIsGate(@Param("userMobile") String userMobile);

    Integer updateShopGateStock(@Param("goodsNum")Integer goodsNum,@Param("commonId")Integer commonId, @Param("goodsId")Integer goodsId, @Param("shopGateId")Integer shopGateId);

    /**
     * 查询门店是否存在
     * @param shopGateId
     * @return
     */
    GdbShopGatePoVO queryShopGateId(@Param("shopGateId")String shopGateId);

    /**
     * 根据用户id 查询门店信息
     * @param userId
     * @return
     */
    Map<String, Object> queryGateShopIdByUserId(@Param("userId")String userId);

    /**
     * 查询附近门店
     * @param gateQueryStoreDTO
     * @return
     */
    List<GoodsGateVO> selectAppGateStore(@Param("param")GateQueryStoreDTO gateQueryStoreDTO);

    /**
     * 查询门店店铺名称
     * @param orderGateShopId
     * @return
     */
    String queryGateStoreName(@Param("orderGateShopId")Integer orderGateShopId);



    Integer updateGateStore(@Param("param") GateStoreUpdateDTO gateStoreUpdateDTO);


    IPage<ShopGateEntity> queryGateStore(IPage<ShopGateEntity> page , @Param("param") GateQueryStoreDTO param);

    List<GoodsGateDTO> queryGateGoods();

    String queryAddressNameById(@Param("id") String id);

    List<GoodsInfoDTO> queryGoodsInfo(@Param("shopId") Integer shopId);

    IPage<GoodsInfoDTO> queryGoods(Page<GoodsInfoDTO> page,@Param("param") Map<String, Object> param);
}




